<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title>
<meta name="keywords" content="{$SEO['keyword']}">
<meta name="description" content="{$SEO['description']}">
<link href="{CSS_PATH}news.css" rel="stylesheet" type="text/css" />
<link href="{CSS_PATH}table_form.css" rel="stylesheet" type="text/css" />
<link href="{CSS_PATH}guestbook.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{JS_PATH}jquery.min.js"></script>
<script type="text/javascript" src="{JS_PATH}formvalidator.js" charset="UTF-8"></script>
<script type="text/javascript" src="{JS_PATH}formvalidatorregex.js" charset="UTF-8"></script>
</head>
<body class="GBook">
{template "content","block-header"}
<div class="Main">
    <div class="List _float">
        <div class="path">
            <a href="{siteurl($siteid)}"><b>网站首页</b></a><span> &gt; </span>
            <a href="{APP_PATH}index.php?m={ROUTE_M}&siteid={$siteid}">留言板</a><span> &gt; </span>签写留言
        </div>
        <div class="cbox">
            <div class="nav-gb">
                <a href="/index.php?m=guestbook&c=index&a=register"><img src="{IMG_PATH}web/guest_write.gif" /></a>
                <a href="/index.php?m=guestbook&c=index&siteid={$siteid}"><img src="{IMG_PATH}web/guest_all.gif" /></a>
            </div>
            <form action="{APP_PATH}index.php?m=guestbook&c=index&a=register&siteid={$siteid}" method="post" name="myform" id="myform">
            <table width="100%" cellspacing="0" cellpadding="0" class="forms">
                <caption class="title"><div class="name">请留下您的宝贵意见，谢谢！</div></caption>
                <tbody>
                    <tr>
                        <td colspan="2" class="tips">
                            <span>友情提醒：</span>{pc:block pos="gb-notes"}{/pc}
                        </td>
                    </tr>
                    <tr>
                        <th width="100">姓　　名：</th>
                        <td>
                            <input type="text" value="" id="name" name="name" class="input-text">
                        </td>
                    </tr>
                    <tr>
                        <th>性　　别：</th>
                        <td>
                            <input type="radio" value="男" name="sex" checked="checked"/>
                            男&nbsp;&nbsp;
                            <input type="radio" value="女" name="sex"/>
                            女</td>
                    </tr>
                    <tr>
                        <th>联系 QQ：</th>
                        <td>
                            <input type="text" size="40" value="" name="lxqq" id="lxqq" class="input-text">
                        </td>
                    </tr>
                    <th>电子邮箱：</th>
                        <td>
                            <input type="text" size="40" value="" name="email" id="email" class="input-text">
                        </td>
                    </tr>
                    <tr>
                        <th>常用电话：</th>
                        <td>
                            <input type="text" size="40" value="" name="tel" id="tel" class="input-text">
                        </td>
                    </tr>
                    <tr>
                        <th>所属分类：</th>
                        <td width="300">
                            <select  style="width: 36%;" id="typeid" name="typeid">
                                <option value="0">默认分类</option>
                                {loop $types $type_arr}
                                <option value="{$type_arr['typeid']}">{$type_arr['name']}</option>
                                {/loop}
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>填写留言：</th>
                        <td>
                            <textarea name="introduce" class="input-text" id="introduce" style='width:500px;height:120px;'></textarea>
                        </td>
                    </tr>
                    {if $setting[1]['enablecheckcode']=='1'}
                    <tr>
                        <th>验证码：</th>
                        <td>
                            <input name="code" type="text" id="code" size="10"  class="input-text"/>
                            {form::checkcode('code_img','4','14',110,30)}</td>
                    </tr>
                    {/if}
                    <tr>
                        <th></th>
                        <td height="80">
                            <input type="submit" value=" 提 交 " name="dosubmit" class="button">
                            <input type="reset" value=" 取 消 " name="reset" class="button">
                        </td>
                    </tr>
                </tbody>
            </table>
            </form>
        </div>
    </div>
    <div class="Side _float2r">
        <div class="ad-1">
            <script language="javascript" src="{APP_PATH}index.php?m=poster&c=index&a=show_poster&id=10"></script>
        </div>
        <div class="bk-10"></div>
        <div class="box-side _float2r" style="position:relative;">
            <div class="flower"></div>
            <div class="box-hotel">
                <table border="0" width="100%" class="title">
                    <tr>
                        <td width="12" class="icon"><img src="{IMG_PATH}web/icon3.png" /></td>
                        <td class="name">热门酒店推荐</td>
                        <td align="right" class="more"></td>
                    </tr>
                </table>
                <div class="plist">
                    {pc:content action="position" posid="12"  order="listorder DESC" thumb="1" num="4"}
                        {loop $data $r}
                        <a href="{$r[url]}" target="_blank" title="{$r[title]}">
                            <img src="{thumb($r['thumb'],214,0)}" />
                            <label>{str_cut($r[title],45,'')}</label>
                        </a>
                        {if $n < count($data)}
                        <div class="line2"></div>
                        {/if}
                        {/loop}
                    </ul>
                    {/pc}
                </div>
            </div>
        </div>
    </div>
    <div class="_clear"></div>
</div>
<script type="text/javascript">
<!--
$(function(){
    $.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
    $("#name").formValidator({onshow:"请输入姓名",onfocus:"请输入姓名"}).inputValidator({min:4,max:10,onerror:"姓名应该为2-5个汉字"}).regexValidator({regexp:"ps_username",datatype:"enum",onerror:"姓名格式错误"});
    /*
    $("#email").formValidator({onshow:"请输入电子邮箱",onfocus:"请输入电子邮箱",oncorrect:"邮箱格式正确"}).inputValidator({min:2,max:32,onerror:"邮箱应该为2-32位之间"}).regexValidator({regexp:"email",datatype:"enum",onerror:"请填写正确的邮箱地址"});
    $("#lxqq").formValidator({onshow:"请输入QQ号码",onfocus:"请输入QQ号码",oncorrect:"QQ格式正确"}).inputValidator({min:5,max:10,onerror:"QQ号码应该为5-10位之间"}).regexValidator({regexp:"^[0-9]{5,20}$",onerror:"请填写正确的腾讯QQ号"});
    $("#tel").formValidator({onshow:"请输入联系电话",onfocus:"请输入联系电话",oncorrect:"电话格式正确"}).inputValidator({min:8,max:13,onerror:"电话号码应该为8-13为之间"}).regexValidator({regexp:"^[0-9-]{6,13}$",onerror:"请填写正确的电话号码"});
    */
    $("#introduce").formValidator({onshow:"请输入留言内容",onfocus:"请输入留言内容"}).inputValidator({min:5,max:500,onerror:"5-500个字之间"});
    
    $("#code").formValidator({onshow:"请输入验证码",onfocus:"验证码不能为空"}).inputValidator({min:1,max:999,onerror:"验证码不能为空"}).ajaxValidator({
        type : "get",
        url : "",
        data :"m=pay&c=deposit&a=public_checkcode",
        datatype : "html",
        async:'false',
        success : function(data){    
            if(data == 1) return true;
            else return false;
            },
        buttons: $("#dosubmit"),
        onerror : "验证码错误",
        onwait : "验证中"
    });
})
//-->
</script>
{template "content","block-footer"}
</body>
</html>
